import { ref } from 'vue'

// 创建全局状态
const activeSelectId = ref<string | null>(null)

export const useSelectState = () => {
    const setActiveSelect = (id: string | null) => {
        activeSelectId.value = id
    }

    const isSelectActive = (id: string) => {
        return activeSelectId.value === id
    }

    return {
        activeSelectId,
        setActiveSelect,
        isSelectActive
    }
} 